# Script usado para reconhecer o resultado do model check

import sys
import string
import re

def getModelCheckPattern():
    return "==========================================\nreduce in (.*): modelCheck\((.*), (.*)\) .\nrewrites: .* \(~ rewrites/second\)\nresult (.*):(.*)"

def getHeaderPattern():
    return "=========================================="

def getStartOfLinePattern():
    return "(==========================================|reduce|rewrites)"

def getEndPattern():
    return "Bye."

def match(pattern, line):
    return re.match(pattern, line)

lines = sys.stdin.readlines()

modelChecks = []
index = -1
for i in lines:
    if (match(getHeaderPattern(), i)):
        index += 1
        modelChecks.append("")
    if (index > -1 and not match(getEndPattern(), i)):
        if (not match(getStartOfLinePattern(), i)):
            i = string.replace(i, "\n", "")
        modelChecks[index] += i

for i in modelChecks:
    print i

#file_name = raw_input("Nome: ")
#print file_name

#var_file = open(".resultado","w")
#var_file.close()
